package com.itheima.tcp.Demo1;

import java.io.*;
import java.net.ServerSocket;
import java.net.Socket;

public class ServerDemo {
    public static void main(String[] args) throws IOException {
        ServerSocket ss = new ServerSocket(10000);
        Socket a = ss.accept();
        BufferedReader br = new BufferedReader(new InputStreamReader(a.getInputStream()));
        BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(a.getOutputStream()));
        String line;
        while((line = br.readLine())!=null){
            System.out.println("收到了一句"+line);
        }
        bw.write("你谁啊");
        bw.newLine();
        bw.flush();
        a.close();
        ss.close();
    }
}
